﻿<basics2:ChildWindow
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:basics="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:basics2="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
    xmlns:local="clr-namespace:Rawr.UI"
    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
    xmlns:inputToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
    mc:Ignorable="d"
    x:Class="Rawr.UI.GemmingTemplates"
    Title="Edit Gemming Templates"
    Height="540" Width="590">
    
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Popup x:Name="GemPopup">
            <local:ItemListControl x:Name="ComparisonGemList"/>
        </Popup>
        <Popup x:Name="CogwheelPopup">
            <local:ItemListControl x:Name="ComparisonCogwheelList"/>
        </Popup>
        <Popup x:Name="HydraulicPopup">
            <local:ItemListControl x:Name="ComparisonHydraulicList"/>
        </Popup>
        <Popup x:Name="MetaPopup">
            <local:ItemListControl x:Name="ComparisonMetaList"/>
        </Popup>

        <TextBlock TextWrapping="Wrap" VerticalAlignment="Top" Margin="8,0" Grid.Row="0" Text="Check the Template Groups you primarily use or check individual Templates. Click Add to add a new Custom Template and click the Boxes to fill them with the Gem Types."/>
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Top" Margin="8,0" Grid.Row="1" Text="Rawr will build gemmings of each known item, based on enabled gemming templates. The following gemming templates are defined for the current model:"/>

        <ScrollViewer Margin="4,2" VerticalScrollBarVisibility="Auto" Grid.Row="2" >
            <StackPanel>
                <TextBlock x:Name="ColLabels" Text="                          Red       Yellow        Blue       Prismatic     Meta   Cogwheel Cogwheel2 Hydraulic" TextWrapping="Wrap"/>
                <StackPanel x:Name="GroupStack" Orientation="Vertical">
                    <!-- This is where new templates get added -->
                </StackPanel>
                <toolkit:Expander IsExpanded="true">
                    <toolkit:Expander.Header>
                        <CheckBox x:Name="CustomCheck" Content="Custom" IsThreeState="True" Checked="groupCheckBox_Checked" Unchecked="groupCheckBox_Checked" Indeterminate="groupCheckBox_Checked"/>
                    </toolkit:Expander.Header>
                    <StackPanel>
                        <StackPanel x:Name="CustomStack"/>
                        <Button x:Name="AddButton" Margin="2,2,2,2" HorizontalAlignment="Left" Content="Add" Width="46" Click="AddTemplate"/>
                    </StackPanel>
                </toolkit:Expander>
            </StackPanel>
        </ScrollViewer>

        <StackPanel Grid.Row="3" Orientation="Horizontal" Margin="4,2,4,2" HorizontalAlignment="Center">
            <TextBlock VerticalAlignment="Center" Text="Top Gemmings to Show:" Margin="0,0,2,0"/>
            <inputToolkit:NumericUpDown x:Name="GemmingsShownNum" Width="50" Margin="2,0,0,0" ValueChanged="GemmingsShownChanged" Maximum="25"/>
        </StackPanel>

        <TextBlock x:Name="LB_GemInfo" Grid.Row="4" TextWrapping="Wrap" Margin="8,0" Text="Rawr will show the top {0} gemmings for an item, plus any equipped or custom gemmings, if not already included in the top {0}." />

        <Button x:Name="OKButton" Content="Done" Click="OKButton_Click" Width="75" HorizontalAlignment="Right" Grid.Row="5" Margin="4,2,4,4" />
    </Grid>
</basics2:ChildWindow>